<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.list.drugqualityspecSTDLoglistSee"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
							
    <section class="content-header">
        <h1><spring:message code="message.list.drugqualityspecSTDLoglistSee"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.drugqualityspecStd"/></a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="form-inline">
                      <div class="form-group form-group-xs">
                        <label><spring:message code="message.listForm.xiuGaiRiQi"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <input class="form-control" id="startTime" name="startTime" type="text" placeholder="yyyy-MM-dd"  
                         onFocus="var endDate=$dp.$('endTime');WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}'})"  />
                        <label>-</label>
                        <input class="form-control" id="endTime" name="endTime" type="text" placeholder="yyyy-MM-dd"  
                        onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}'})"   />
                    </div>
                   <button id="selectSpec" type="button" class="btn btn-success btn-sm" onclick="search();"><spring:message code="message.button.seachSpacing"/></button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <div class=" box box-warning bottongroup">
             <label class="btn btn-default btn-sm" onclick="back()"><spring:message code="message.button.getBackSpacing"/></label>
        </div>
  
    </section>
    
     <%@ include file="/WEB-INF/component/commonJS.jsp" %>  
    
    <script type="text/javascript">	
		    function back(){
		     	window.location.href="toDrugQualitySpecList.html";
		     }
    	function search(page) {
    		var startTime = $("#startTime").val();
         	if (startTime.length>0){
         		startTime = startTime + " 00:00:00";
         	}
         	var endTime = $("#endTime").val();
         	if (endTime.length>0){
         		endTime = endTime + " 23:59:59";
         	}
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{
    	        	"startPoint":startTime, 
    	        	"endPoint":endTime
    	        },
    	        page : 1
    	    }).trigger("reloadGrid"); //重新载入  
    	}
    
        $(function () {
        	
        	//绑定回车
            $('#startTime,#endTime').bind('keydown', function(event) {
                if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
                    $('#selectSpec').click();
                }
            }); 
        	
            $("#gridlist").jqGrid({
                url: "getDrugQualitySpecLogList.html?qualitySpecId=${qualitySpecId}",
                mtype: "post",
                datatype: "json",
                autowidth: true,
                height: 270,
                colNames: [
                    '<spring:message code="message.jqGrid.cz"/>',
                    '<spring:message code="message.jqGrid.cz.xiangQing"/>',
					'<spring:message code="message.listForm.xiuGaiRen"/>',
					'<spring:message code="message.listForm.xiuGaiShiJian"/>'
					
                ],
                colModel: [
					{ name: 'operate', width: 10, align:"center", sortable: false,
					    formatter : function(val, opts, rowdata) {
					        var str =  "<a href='${ctx}/stdDrugQualitySpec/toStdDrugQualitySpecLogDetail.html?logId=" + rowdata.logId + "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>";
					        return str;
					        }
					},
					{ name: 'detail', width: 110, align:"left", sortable: false},
                    { name: 'updUser', width: 20, align:"center", sortable: false},
                    { name: 'updDatetime', width: 30, align:"center", sortable: false}
                ],
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: false, 
                viewrecords: true,
                caption: "${qualitySpecCode} - ${qualitySpecName}&nbsp;<spring:message code="message.jqGrid.cz.weiHuJiLuLieBiao"/>",
                jsonReader: {
                    id: "logId"
                }
            });
            
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            
            $("#area2").HNSelect({
                url: "${ctx}/selectController/getArea.html", 
                data: { ID: '330000' },
                defaultText: "<option value=''><spring:message code="message.select.option"/></option>",
                defaultselect: "",
                func: function () {
                    $("#area3").HNSelect({
                        parent_selector: "#area2", 
                        url: "${ctx}/selectController/getArea.html", 
                        dataid: "ID", 
                        defaultText: "<option value=''><spring:message code="message.select.option"/></option>",
                        defaultselect: ""
                    });
                }
            });
            $("#hospClassify").HNSelect({
                url: "${ctx}/selectController/getArchiveType.html", 
                data: { classifyCode: "113" },
                defaultText: "<option value=''><spring:message code="message.select.option"/></option>",
                defaultselect: "",
            });

            $(window).trigger("resize");
            
        });
    </script>
</body>
</html>












